package app.dev.ems.data.model.impl;

import java.util.ArrayList;
import java.util.List;

import app.dev.ems.data.element.FieldType;

public class ProfileSettings extends BaseSettings {

	private static final long serialVersionUID = -7300709312438347281L;

	private String textfield1;
	private String textfield2;
	private String textfield3;
	
	private List<String> dropdown1;
	private List<String> dropdown2;

	private List<Field> fields;
	
	public ProfileSettings() {
		
	}
	
	public String getTextfield1() {
		return textfield1;
	}

	public void setTextfield1(String textfield1) {
		this.textfield1 = textfield1;
	}	

	public String getTextfield2() {
		return textfield2;
	}

	public void setTextfield2(String textfield2) {
		this.textfield2 = textfield2;
	}
	
	public String getTextfield3() {
		return textfield3;
	}

	public void setTextfield3(String textfield3) {
		this.textfield3 = textfield3;
	}	
			
	public List<String> getDropdown1() {
		return dropdown1;
	}

	public void setDropdown1(List<String> dropdown1) {
		this.dropdown1 = dropdown1;
	}

	public List<String> getDropdown2() {
		return dropdown2;
	}

	public void setDropdown2(List<String> dropdown2) {
		this.dropdown2 = dropdown2;
	}

	public List<Field> getFields() {
		return fields;
	}

	public void setFields(List<Field> fields) {
		this.fields = fields;
	}

	@Override
	public void initialize() {
		fields = new ArrayList<Field>(0);
		initializeTextfield();
		initializeDropdown();
		fields.add(new Field(FieldType.NONE, "none", "None", false));
	}
	
	private void initializeTextfield() {
		for(int i = 1; i <= 3; i++) {
			fields.add(getTextField(i));
		}
	}
	
	private void initializeDropdown() {
		for(int i = 1; i <= 3; i++) {
			fields.add(getDropdown(i));
		}
	}
	
	private Field getTextField(int i) {			
		return new Field(FieldType.TEXT_FIELD, "textfield" + i, "Textfield", false);
	}
	
	private Field getDropdown(int i) {			
		return new Field(FieldType.DROP_DOWN, "dropdown" + i, "Dropdown", false);
	}
}
